<%-- 
    Document   : index
    Created on : 22-mar-2014, 14:53:41
    Author     : Desarrollador
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="DAO.datUsuario"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
  <body>
      <br>
      <h3 align="center">Acceso a Sistema</h3>
      <br/>
<form>
    <table align="center" border="1">
       <tr>
         <td>usuario:</td>
         <td><input type="text" name="txtUsuario"/></td>
       </tr>
       <tr>
           <td>Password:</td>
           <td>
               <input type="password" name="txtpassword"/>
           </td>
       </tr>
       <tr>
           <td colspan="2" align="center">
            <input type="submit" name="btnIngresar" value="Ingresar"/>
         </td>
       </tr>
    </table>
</form>
  <%
      if(request.getParameter("btnIngresar")!=null){
          int Veri = 0;
          Veri = datUsuario.VerificarAcceso(request.getParameter("txtUsuario"), request.getParameter("txtpassword"));
          if(Veri>0){
          response.sendRedirect("frmPrincipal.jsp");
          }else{
              out.print("<script>alter('Usuario o Password no valido')</script>");
          }
      }
  
      %>
  </body>
</html>
